<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>管理员登录-Bug统计考量脚本 1.0</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
    <link type="text/css"  rel="stylesheet" href="../static/css/font.css">
	<link type="text/css" rel="stylesheet" href="../static/css/weadmin.css">
    <script type="text/javascript" src="../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../lib/jquery-3.2.1.min.js"></script>
</head>
<body >

<button id="getUserList"   style="width:50%;height: 40px" >获取用户信息</button>
<!--
 <button type="button" class="layui-btn layui-btn-normal">百搭按钮</button>
<button id="getUserList" value="获取用户信息"  lay-filter="getUserList" style="width:50%;" type="button"></button>
-->
<!-- 定义表单相关校验 -->
<script type="text/javascript">
    //<!--定义layer-->


    layui.extend({
				admin: '{/}./static/js/admin'
			});
    layui.use('form', function () {
        var form = layui.form;

          //自定义验证规则
          form.verify({
            username: function(value){
              if(value.length < 6){
                return '用户名至少得6个字符啊';
              }
              if(value.length > 12){
                return '用户名不能超过12个字符啊';
              }
            }
            ,password: [
              /^[\S]{6,12}$/
              ,'密码必须6到12位，且不能出现空格'
            ]

          });

          //监听提交
              form.on('submit(login)', function(data){
                // alert(888)

                layer.msg(JSON.stringify(data.field),function(){
                    //返回成功
                    if(1=2){
                        location.href='index.html'
                    }
                });
                //

                return false;
              });


    });

</script>

<script>
    //店家按钮
              $("button[id='getUserList']").click(function (){
                console.log('前台点击了按钮');
                $.post('/getUserList',function (returnJsonData, serverBackStatus, xhr) {
                    console.log("returnJson==" + returnJsonData);
                    console.log("code==" + returnJsonData.code);

                    if(serverBackStatus == "success"){
                        //解析json
                        console.log("返回==成功" + serverBackStatus);
                        console.log("解析json")
                        var jsonObj = $.parseJSON(returnJsonData)
                        console.log("解析后的json==" + jsonObj)

                        console.log("响应码==="+jsonObj.msg)
                    }else{
                        console.log("返回失败")
                    }
                    console.log(serverBackStatus);
                    console.log(xhr);

                });

              })

</script>
</body>
</html>